package org.desktop.web.server;

import java.util.Map;

import org.desktop.web.client.customer.CustomerService;
import org.desktop.web.server.locator.ServiceLocator;
import org.desktop.web.server.locator.ServiceLocator.ServiceName;
import org.desktop.web.server.util.RpcUtil;
import org.desktop.web.shared.domain.entities.CustomersEnabled;

import com.sencha.gxt.data.shared.loader.PagingLoadConfig;
import com.sencha.gxt.data.shared.loader.PagingLoadResult;

public class CustomerServiceImpl extends
		AbstractPagingService<CustomersEnabled> implements CustomerService {

	private String customers = RpcUtil.createUrlService(ServiceLocator.find(ServiceName.TIMESHEET_SERVICE),"customersenableds");

	@Override
	public PagingLoadResult<CustomersEnabled> getCustomers(
			Map<String, String> headers, PagingLoadConfig loadConfig)
			throws Exception {
		try {
			return getDatas(headers, loadConfig, customers);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
	}

	@Override
	public Class<?> getType() {
		// TODO Auto-generated method stub
		return CustomersEnabled.class;
	}

}
